package com.yyfax.pay.common.enums;

import com.yyfax.framework.yyfax.enums.UserTypeEnum;
import com.yyfax.pay.common.exception.PayExceptionCode;

/**
 * 富友支付主题枚举
 * 
 * @author buyi
 * @date 2017-08-30 10:31:42
 * @since v2.0.0
 */
public enum FuiouSubjectTypeEnum {
	/** 个人 */
	B2C,
	/** 企业 */
	B2B;

	public static FuiouSubjectTypeEnum parse(UserTypeEnum userType) {
		if (UserTypeEnum.NATURAL_PERSON == userType) {
			return FuiouSubjectTypeEnum.B2C;
		} else if (UserTypeEnum.NON_NATURAL_PERSON == userType) {
			return FuiouSubjectTypeEnum.B2B;
		}

		throw PayExceptionCode.ERROR_ILL_PARAMETER.expMsg("类型转换不匹配");
	}
}
